#ifndef C5DLG_H
#define C5DLG_H

#include <QDialog>
#include <QProgressDialog>
#include <vector>
#include "ui_C5Dlg.h"

class C5Dlg : public QDialog
{
	Q_OBJECT

public:
	C5Dlg(QWidget *parent = 0, int svmType = 0);
	~C5Dlg();
private slots:
	void setSVMInputLayer();
	void classify();
	void addShp();
	//void addShps();
	void deleteSelectedShps();
	void deleteAllShps();
	void onSelectClassImageSavePath();
	void onSelectRuleImageSavePath();
private:
	void addShpToList(const QString& shpPath);
	void connectSignalSlot();
	void initializeGui();
	void setSVMRasterLayer();
	void setSVMVectorLayer();
	void resetImageSelectedClassFieldTable();
	void resetVectorSelectedClassFieldTable();
	std::vector<QString> getSelectedClassFields();
	std::vector<int> getSelectedClassFieldsIndex();
	std::pair<bool, QString> generateSamples();
	std::pair<bool, QString> generateImageSamples();
	std::pair<bool, QString> generateShpSamples();
	void getRandVec(std::vector<bool> &tagVec, int nFeatureCount);
	void doClassify();
private:
	Ui::C5Dlg ui;
	int _svmType; //0: image;  1:shapefile
	QProgressDialog* _progressDialog;
	QString _outputDir;
	QString m_strOpenRSImages;
	QString _doClassifyLastError;
	QString m_strTempTrainingSamples;
	QString m_strTempTestingSamples;
};

#endif // C5DLG_H
